import request from '@/utils/request';

/**
 * 新增配件
 */
export const addDemo = (data: any) => {
  return request({
    url: '/sj/productComponentBasic',
    method: 'post',
    data: data
  });
};

/**
 * 配件列表
 */
export const getDemoList = (params: any) => {
  return request({
    url: '/sj/productComponentBasic/list',
    method: 'post',
    data: params
  });
};

/**
 * 删除配件
 */
export const deleteDemo = (data: any) => {
  return request({
    url: '/sj/productComponentBasic/remove',
    method: 'delete',
    params: data
  });
};

/**
 * 配件详情
 */
export const getDemoDetail = (id: any) => {
  return request({
    url: `/sj/productComponentBasic/${id}`,
    method: 'get'
  });
};

/**
 * 更新配件
 */
export const updateDemo = (data: any) => {
  return request({
    url: '/sj/productComponentBasic',
    method: 'put',
    data: data
  });
};

/**
 * 新增工艺
 */
export const addNewProcess = (data: any) => {
  return request({
    url: '/sj/workmanshipDetail',
    method: 'post',
    data: data
  });
};

/**
 * 工艺列表
 */
export const getProcessList = (data: any) => {
  return request({
    url: '/sj/workmanshipDetail/list',
    method: 'post',
    data
  });
};

/**
 * 删除工艺
 */
export const deleteProcess = (data: any) => {
  return request({
    url: '/sj/workmanshipDetail/remove',
    method: 'delete',
    params: data
  });
};

/**
 * 工艺详情
 */
export const getProcessDetail = (id: any) => {
  return request({
    url: `/sj/workmanshipDetail/${id}`,
    method: 'get'
  });
};

/**
 * 更新工艺
 */
export const updateProcess = (data: any) => {
  return request({
    url: '/sj/workmanshipDetail',
    method: 'put',
    data: data
  });
};